<?php
/**
 * Created by PhpStorm.
 * User: lili
 * Date: 2019/1/1
 * Time: 17:51
 */

namespace app\index\model;


use system\core\model\Model;

class note extends Model
{

    /*
     * 设置增加留言
     *
     * */
    public function setNote($name,$phone,$email,$note){
        $sql = "insert into note (name,phone,email,note) VALUES ('$name','$phone','$email','$note')";
          
        $res = $this->query($sql);
        return $res;
    }

    /*
     * 搜索某一数据
     *
     * */

    public function getOne($id){
        $sql = "select * from note WHERE id = $id limit 1 ";
        $res = $this->query($sql);
        if ($res!==false){
            return $res[0];
        }else{
            return false;
        }

    }


}